import service from '@/utils/request'
// @Tags Device
// @Summary 创建设备表
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data body model.Device true "创建设备表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /device/createDevice [post]
export const createDevice = (data) => {
  return service({
    url: '/device/createDevice',
    method: 'post',
    data
  })
}

// @Tags Device
// @Summary 删除设备表
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data body model.Device true "删除设备表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /device/deleteDevice [delete]
export const deleteDevice = (params) => {
  return service({
    url: '/device/deleteDevice',
    method: 'delete',
    params
  })
}

// @Tags Device
// @Summary 批量删除设备表
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除设备表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /device/deleteDevice [delete]
export const deleteDeviceByIds = (params) => {
  return service({
    url: '/device/deleteDeviceByIds',
    method: 'delete',
    params
  })
}

// @Tags Device
// @Summary 更新设备表
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data body model.Device true "更新设备表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /device/updateDevice [put]
export const updateDevice = (data) => {
  return service({
    url: '/device/updateDevice',
    method: 'put',
    data
  })
}

// @Tags Device
// @Summary 用id查询设备表
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data query model.Device true "用id查询设备表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /device/findDevice [get]
export const findDevice = (params) => {
  return service({
    url: '/device/findDevice',
    method: 'get',
    params
  })
}

// @Tags Device
// @Summary 分页获取设备表列表
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取设备表列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /device/getDeviceList [get]
export const getDeviceList = (params) => {
  return service({
    url: '/device/getDeviceList',
    method: 'get',
    params
  })
}

// @Tags Device
// @Summary 不需要鉴权的设备表接口
// @Accept application/json
// @Produce application/json
// @Param data query systemReq.DeviceSearch true "分页获取设备表列表"
// @Success 200 {object} response.Response{data=object,msg=string} "获取成功"
// @Router /device/getDevicePublic [get]
export const getDevicePublic = () => {
  return service({
    url: '/device/getDevicePublic',
    method: 'get',
  })
}
// searchDevice 根据设备编号，设备名称，设备类型，设备地址，设备售后人员，设备版本来查询
// @Tags Device
// @Summary 根据设备编号，设备名称，设备类型，设备地址，设备售后人员，设备版本来查询
// @Accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{data=object,msg=string} "成功"
export const searchDevice = (params) => {
  return service({
    url: "/device/search",
    method: "GET",
    params: params
  })
}
// 填充funcName 
// @Tags Device
// @Summary 查询设备信息
// @Accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{data=object,msg=string} "成功"
// @Router /device/search [GET]
// export const searchDevice = () => {
//   return service({
//     url: '/device/search',
//     method: 'get',
//     params: {
//       device_sn: '设备编号',
//       device_name: '设备名称',
//       device_type: '设备类型',
//       device_address: '设备地址',
//       device_after_sales: '设备售后人员',
//       device_version: '设备版本',
//       device_status: '设备状态',
//     }
//   })
// }
// Running 运行监测
// @Tags Device
// @Summary 运行监测
// @Accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{data=object,msg=string} "成功"
// @Router /device/running [GET]
export const running = (params) => {
  return service({
    url: '/device/running',
    method: 'get',
    params
  })
}
// Realtime 实时监测数据
// @Tags Device
// @Summary 实时监测数据
// @Accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{data=object,msg=string} "成功"
// @Router /device/realtime [GET]
export const realtime = () => {
  return service({
    url: '/device/realtime',
    method: 'GET'
  })
}
// Address 可以根据设备状态和设备地址在地图上展示所有设备的所在地，以及所有设备的状态
// @Tags Device
// @Summary 可以根据设备状态和设备地址在地图上展示所有设备的所在地，以及所有设备的状态
// @Accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{data=object,msg=string} "成功"
// @Router /device/address [GET]
export const address = () => {
  return service({
    url: '/device/address',
    method: 'GET'
  })
}
